<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%-- Add portlet taglibs to jsp --%>
<%@ page import="javax.portlet.*"%>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>

<portlet:defineObjects/>

<script type="text/javascript" src='/${requestScope.contextPath}/scripts/common.js' ></script>

<b>Demo Using Form in MVCPortlet</b>
<br/>
<form name="<portlet:namespace/>add" action="<portlet:actionURL/>" method="POST" enctype="multipart/form-data">
  <input type="hidden" name="screenId" value="Add"/>
  <input type="hidden" name="eventId" value="default"/>
  <font color="red">${requestScope.ERROR}</font>
  <br/>
  
  User name: <input name="username" value="${requestScope.formBean.username}">
  <br/>
  Birthday: <input name="birthday" value="${requestScope.formBean.birthday}">(dd/mm/yyyy)
  <br/>
  
  Picture: <input type="file" name="attachedFile"/>
  <br/>
  The attached file will be save at folder (on server):
  <input name="rootPath" value="${requestScope.formBean.rootPath}">
  <br/>
  <input type="button" name="ok" value="OK" onclick='submitAction("<portlet:namespace/>","add","ok");'/>
  &nbsp;
  &nbsp;
  <input type="button" name="list" value="List" onclick='submitAction("<portlet:namespace/>","add","list");'/>
  <br/>
  ${requestScope.MESSAGE}
</form>
  